import re

word = "Why I balbala 123 balabala"
result = re.match('.*?(\d+).*', word)
print(f'groups :{result.groups()}')  # ('123', )
print(f'group :{result.group()}')  # Why I balbala 123 balabala
print(f'group 0:{result.group(0)}')  # Why I balbala 123 balabala
print(f'group 1:{result.group(1)}')  # 123


text = '''I think
        what 123 is my number.
        difsn 4556 is '''

result1 = re.match('.?(\d+)', text)
result2 = re.search('.?(\d+)', text)

# print(result1.groups()) # 'NoneType' object has no attribute 'groups'
print(result2.groups())  # ('123',)
